// swiper轮播
$('.button_close').on('click',function(){
    $('.sw_hd').css({
        display:"none"
    })
})
$('.imgContainer').on('click',function(){
    $('.sw_hd').css({
        display:"block"
    })
})
// 放大镜
var index = false
$('.imgContainer>.smallpics>li').on('mouseover', 'img', function (e) {
    if (index == false) {
        var x_ = e.clientX
        var y_ = e.clientY
        $(this).children().css({
            'transform': `scale(2.7)`
        })
        $('.smallpics>li').on('mouseout', function () {
            $(this).children().css({
                'transform': 'scale(1)'
            })
        })
        $('.smallpics>li').on('mousemove', function (e) {
            if (index == false) {
                return
            }
            x = e.clientX - x_
            y = e.clientY - y_
            console.log(x)
            $(this).children().css({
                'transform': `translate(${-x}px,${-y}px) scale(2.7)`
            })
           
        })
    } else {
        $(this).css({
            'transform': 'scale(1)'
        })
       
        console.log($(this).children())
    }

    index = !index
})